<?php
require_once "globalFunctions.php";

// An event subscriber waits for event callbacks and responds as they are invoked.
class EventSubscriber {
	//private $subscriptions = array("dummyEvent");
	function __construct ($name) {
		$this->name = $name;
		$this->makeSubscriptionsFromArray($this->subscriptions);
	}

	function makeSubscription (&$subscriber, $event) {
		$eventProviderRef = getEventProvider();
		$eventProviderRef->addSubscription($subscriber, $event);
	}
	function makeSubscriptionsFromArray ($array) {
		if (!empty($array)) {
			foreach ($this->subscriptions as $subscription) {
				$this->makeSubscription($this->name, $subscription);
			}
		}
	}
	
	function handleEventCallback ($event) {
	}
}

?>